/******************************************************************************
 * ----------------------------------------------------------------------------
 * ACA ASSIGNMENT 3: Simulation of MOESI cache coherence
 * Name: Shriram Gurumoorthy
 * GTID: 902535405
 * Email: shriram.g@gatech.edu
 *
 * This file provides the utility functions needed by the MOESI simulator
 * ----------------------------------------------------------------------------
 * ***************************************************************************/
#ifndef __UTILS_H__
#define __UTILS_H__

#include "globals.h"

extern unsigned int DMSize;
extern unsigned int DMCacheLineSize;
extern unsigned int DMNumCacheLine;
extern unsigned int DMIndexBits;
extern unsigned int DMOffsetBits;
extern unsigned int SASize;
extern unsigned int SACacheLineSize;
extern unsigned int SANumCacheLine;
extern unsigned int SANumber;
extern unsigned int SAIndexBits;
extern unsigned int SAOffsetBits;

/* Function Prototypes */
int getBitCount(int num);

int powerOfTwo(int num);

void error(char *s);

int checkForShare(int addr);

#endif
